package tt.dz.appserver.entity.vo.user;

import java.io.Serializable;

import org.springframework.util.StringUtils;

import com.alibaba.fastjson.JSONObject;

import tt.dz.appserver.util.Constants;

/**
 * 用户详细View
 * @author xielf
 *
 */
public class UserDetailVo implements Serializable {

	private static final long serialVersionUID = 1L;

	private String nickName;
	private String sex;
	private String userId;
	private String signature;
	private String phone;
	private String longitude;
	private String latitude;
	private String carTypeId;
	private String carTypeName;
	private String setPasswordFlag;
	private String token;
	private String address;
	private String userType;
	private String areaCode;
	private UserHeadImageVo headImage;
	
	public String getUserType() {
		return userType;
	}
	public void setUserType(String userType) {
		this.userType = userType;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getSignature() {
		return signature;
	}
	public void setSignature(String signature) {
		this.signature = signature;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getLongitude() {
		return longitude;
	}
	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}
	public String getLatitude() {
		return latitude;
	}
	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}
	public String getCarTypeId() {
		return carTypeId;
	}
	public void setCarTypeId(String carTypeId) {
		this.carTypeId = carTypeId;
	}
	public String getCarTypeName() {
		return carTypeName;
	}
	public void setCarTypeName(String carTypeName) {
		this.carTypeName = carTypeName;
	}
	public String getSetPasswordFlag() {
		return setPasswordFlag;
	}
	public void setSetPasswordFlag(String setPasswordFlag) {
		this.setPasswordFlag = setPasswordFlag;
	}
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public UserHeadImageVo getHeadImage() {
		return headImage;
	}
	
	
	public String getAreaCode() {
		return areaCode;
	}
	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}
	//设置头像
	public void setHeadImage(String headImagePath) {

		if(!StringUtils.isEmpty(headImagePath)){
			UserHeadImageVo userHeadImageVo = JSONObject.parseObject(headImagePath, UserHeadImageVo.class);
			this.headImage = userHeadImageVo;
			userHeadImageVo.setBigImage(Constants.qiniuBaseUrl+userHeadImageVo.getBigImage());
			userHeadImageVo.setSmallImage(Constants.qiniuBaseUrl+userHeadImageVo.getSmallImage());
			userHeadImageVo.setMiddleImage(Constants.qiniuBaseUrl+userHeadImageVo.getMiddleImage());
		}
	}
	
}
